<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.  .org">
<meta charset="utf-8">
<head>
	<th:block th:include="include :: header('新增入库单')"/>
	<th:block th:include="include :: layout-latest-css"/>
	<th:block th:include="include :: ztree-css"/>
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-stockin-add">
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label is-required">物资编号：</label>
						<div class="col-sm-8">
							<input name="productId" id="productId1" placeholder="请输入物资编号" type="text" maxlength="30" readonly>
							<a class="btn btn-primary btn-xs " onclick="selectPro()">...</a>
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label is-required">物资名称：</label>
						<div class="col-sm-8">
							<input name="productName" id="productName1" placeholder="请输入物资名称" type="text" maxlength="30" readonly>
						</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label is-required">价格：</label>
						<div class="col-sm-8">
							<input name="price" placeholder="请输入价格" class="form-control"autocomplete="off" type="text" maxlength="30">
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label is-required">批号：</label>
						<div class="col-sm-8">
							<input name="lotNo" placeholder="请输入批号" autocomplete="off" class="form-control" type="text" maxlength="30"
								   required>
						</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label is-required">数量：</label>
						<div class="col-sm-8">
							<input name="quantity" placeholder="请输入数量" autocomplete="off" class="form-control" type="text" maxlength="30"
								   required>
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label is-required">实际数量：</label>
						<div class="col-sm-8">
							<input name="assignNum" placeholder="请输入实际数量" autocomplete="off" class="form-control" type="text" maxlength="30">
						</div>
					</div>
				</div>
			</div>
			<input type="hidden" th:value="${productId}" id="productId"/>
			<input type="hidden" th:value="${productName}" id="productName"/>
		</form>
	</div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "mydo/stockin";

		(function(){
			var productId = $("#productId").val();
			var productName = $("#productName").val();
			$("#productId1").val(productId);
			$("#productName1").val(productName);
		})();



		function submitHandler() {
			var data = $("#form-stockin-add").serializeArray();
			console.log(data)
			//TODO 如果沒有选择项目组（项目组为空 不允许提交）
			$.operate.save(prefix + "/add", data);
		}

		function selectPro() {
			var url = "/mydo/stockin/selectPro";
			$.modal.open("选择货位信息", url);
		}
	</script>

</body>
</html>
